home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / Libraries / DCLAP 6d / dclap6d / DBio.more / old / USeqDoc.h < prev    next >
Text File  |  1996-07-05  |  7KB  |  344 lines

  1. // USeqDoc.p 
  2. // by d.g.gilbert, Oct 1990 
  3.  
  4.  
  5. UNIT USeqDoc;
  6. INTERFACE
  7.  
  8.  
  9. #ifndef __Types__
  10. #include <Types.h>
  11. #endif
  12.  
  13. #ifndef __Memory__
  14. #include <Memory.h>
  15. #endif
  16.  
  17. #ifndef __QuickDraw__
  18. #include <QuickDraw.h>
  19. #endif
  20.  
  21. #ifndef __ToolUtils__
  22. #include <ToolUtils.h>
  23. #endif
  24.  
  25. #ifndef __OSUtils__
  26. #include <OSUtils.h>
  27. #endif
  28.  
  29. #ifndef __Resources__
  30. #include <Resources.h>
  31. #endif
  32.  
  33. #ifndef __Packages__
  34. #include <Packages.h>
  35. #endif
  36.  
  37. #ifndef __Files__
  38. #include <Files.h>
  39. #endif
  40.  
  41. #ifndef __Printing__
  42. #include <Printing.h>
  43. #endif
  44.  
  45. #ifndef __TextEdit__
  46. #include <TextEdit.h>
  47. #endif
  48.  
  49. #ifndef __Folders__
  50. #include <Folders.h>
  51. #endif
  52.  
  53. #ifndef __Controls__
  54. #include <Controls.h>
  55. #endif
  56.  
  57. #ifndef __Aliases__
  58. #include <Aliases.h>
  59. #endif
  60.  
  61. #ifndef __Editions__
  62. #include <Editions.h>
  63. #endif
  64.  
  65. #ifndef __Events__
  66. #include <Events.h>
  67. #endif
  68.  
  69. #ifndef __Notification__
  70. #include <Notification.h>
  71. #endif
  72.  
  73. #ifndef __AppleEvents__
  74. #include <AppleEvents.h>
  75. #endif
  76.  
  77. #ifndef __Processes__
  78. #include <Processes.h>
  79. #endif
  80.  
  81. #ifndef __Balloons__
  82. #include <Balloons.h>
  83. #endif
  84.  
  85. #ifndef __MacAppTypes__
  86. #include <MacAppTypes.h>
  87. #endif
  88.  
  89. #ifndef __UPascalObject__
  90. #include <UPascalObject.h>
  91. #endif
  92.  
  93. #ifndef __UObject__
  94. #include <UObject.h>
  95. #endif
  96.  
  97. #ifndef __UEventHandler__
  98. #include <UEventHandler.h>
  99. #endif
  100.  
  101. #ifndef __UList__
  102. #include <UList.h>
  103. #endif
  104.  
  105. #ifndef __UAdorners__
  106. #include <UAdorners.h>
  107. #endif
  108.  
  109. #ifndef __UStream__
  110. #include <UStream.h>
  111. #endif
  112.  
  113. #ifndef __UGeometry__
  114. #include <UGeometry.h>
  115. #endif
  116.  
  117. #ifndef __UEvent__
  118. #include <UEvent.h>
  119. #endif
  120.  
  121. #ifndef __UCommand__
  122. #include <UCommand.h>
  123. #endif
  124.  
  125. #ifndef __UCommandHandler__
  126. #include <UCommandHandler.h>
  127. #endif
  128.  
  129. #ifndef __UView__
  130. #include <UView.h>
  131. #endif
  132.  
  133. #ifndef __UBehavior__
  134. #include <UBehavior.h>
  135. #endif
  136.  
  137. #ifndef __UTEView__
  138. #include <UTEView.h>
  139. #endif
  140.  
  141. #ifndef __UTECommands__
  142. #include <UTECommands.h>
  143. #endif
  144.  
  145. #ifndef __UMacAppUtilities__
  146. #include <UMacAppUtilities.h>
  147. #endif
  148.  
  149. #ifndef __UPatch__
  150. #include <UPatch.h>
  151. #endif
  152.  
  153. #ifndef __UFailure__
  154. #include <UFailure.h>
  155. #endif
  156.  
  157. #ifndef __UMacAppGlobals__
  158. #include <UMacAppGlobals.h>
  159. #endif
  160.  
  161. #ifndef __UFile__
  162. #include <UFile.h>
  163. #endif
  164.  
  165. #ifndef __UApplication__
  166. #include <UApplication.h>
  167. #endif
  168.  
  169. #ifndef __UPrintHandler__
  170. #include <UPrintHandler.h>
  171. #endif
  172.  
  173. #ifndef __UPrinting__
  174. #include <UPrinting.h>
  175. #endif
  176.  
  177. #ifndef __UWindow__
  178. #include <UWindow.h>
  179. #endif
  180.  
  181. #ifndef __UMenuMgr__
  182. #include <UMenuMgr.h>
  183. #endif
  184.  
  185. #ifndef __UMemory__
  186. #include <UMemory.h>
  187. #endif
  188.  
  189. #ifndef __UErrorMgr__
  190. #include <UErrorMgr.h>
  191. #endif
  192.  
  193. #ifndef __UControl__
  194. #include <UControl.h>
  195. #endif
  196.  
  197. #ifndef __UDialog__
  198. #include <UDialog.h>
  199. #endif
  200.  
  201. #ifndef __UPopup__
  202. #include <UPopup.h>
  203. #endif
  204.  
  205. #ifndef __UDocument__
  206. #include <UDocument.h>
  207. #endif
  208.  
  209. #ifndef __UFileHandler__
  210. #include <UFileHandler.h>
  211. #endif
  212.  
  213. #ifndef __UFileBasedDocument__
  214. #include <UFileBasedDocument.h>
  215. #endif
  216.  
  217. #ifndef __UViewServer__
  218. #include <UViewServer.h>
  219. #endif
  220.  
  221. #ifndef __UGridView__
  222. #include <UGridView.h>
  223. #endif
  224. USES
  225.     
  226.     /*$U $$Shell(UStd)UStandard.p */ UStandard, 
  227.     /*$U $$Shell(UStd)UApp.p */ UApp, 
  228.     /*$U $$Shell(UText)UTextDoc.p */ UTextDoc,
  229.  
  230.     USequence,
  231.     USeqReader();
  232.  
  233.  
  234. CONST
  235.  
  236.     mSeqListMouseClick == 1111; // seqList "open" selected seqs msg for DoChoice
  237.         
  238.     
  239. TYPE
  240.     
  241.     TSeqList                == OBJECT (TList)
  242.     
  243.         pascal Boolean TSeqList::ListIsEmpty(void)
  244.         pascal void TSeqList::AddNewSeq(void)
  245.         pascal TSequence TSeqList::SeqAt( integer aRow)  
  246.         pascal void TSeqList::ClearSelections(void)
  247.         pascal void TSeqList::doWrite( Str255 aFileName, integer format)  
  248.         pascal void TSeqList::doWriteRef( integer aFileRef, integer format)  
  249.         pascal Handle TSeqList::doWriteHandle( integer format)  
  250.         
  251.         pascal integer TSeqList::ZeroOrigin(void)
  252.         pascal void TSeqList::MakeConsensus(void)
  253.         pascal TSequence TSeqList::Consensus(void)  //may be NULL
  254.         pascal Integer TSeqList::ConsensusRow(void) //0 if NULL
  255.         
  256.         pascal charsHandle TSeqList::FindCommonBases( integer minCommonPerCent, 
  257.                                                     CharsHandle VAR firstCommon)
  258.         }
  259.  
  260.     
  261.     TSeqListView            == OBJECT (TTextListView)
  262.         fSeqList    : TSeqList; //list of TSequence. NOTE: TSeqListDoc "owns" this list
  263.         
  264.         pascal void TSeqListView::Initialize(void) // override 
  265.         pascal void TSeqListView::Infoheadline(Str255 var aStr)
  266.         pascal void TSeqListView::GetItemText(integer anItem, Str255 VAR aString)
  267.                                     // override 
  268.         pascal void TSeqListView::DoMouseCommand(VPoint VAR theMouse, TToolboxEvent event,
  269.                                                Point hysteresis) // override 
  270.         }
  271.         
  272.     
  273.     TSeqSelectCommand == OBJECT(TCellSelectCommand)
  274.         //Override to process command w/ DoIt?
  275.         boolean        fDoubleClick;
  276.         fAtRow            : integer;
  277.         pascal void TSeqSelectCommand::ComputeNewSelection(GridCell VAR clickedCell) 
  278.                                             // override 
  279.         pascal void TSeqSelectCommand::DoIt(void) // override 
  280.         }
  281.         
  282.     TSeqListDlog            == OBJECT (TDialogView)
  283.         pascal void TSeqListDlog::Initialize(void) // override 
  284.         pascal void TSeqListDlog::DoMouseCommand(VPoint VAR theMouse, TToolboxEvent event,
  285.                                                Point hysteresis) // override 
  286.         pascal void TSeqListDlog::CalcMinFrame(VRect VAR minFrame) // override 
  287.         }
  288.         
  289.     TSeqListDoc            == OBJECT (TFileBasedDocument)
  290.         /*this is a "project" document consisting of SeqListView of 1 or more
  291.             sequences from 1 or more files */
  292.             
  293.         fHeadline            :    TStaticText;     //seqlist header
  294.         fSeqList            : TSeqList;                 //the list of TSequences owned by this doc
  295.         fSeqListView    : TSeqListView; //view showing fSeqList
  296.         fFormatPop        :    TPopup;             //seq output format
  297.         fUpdateTime        : longint;            //time of last .showreverted/.updateFlds 
  298.         fInFormat            : integer;            //file input format 
  299.         Boolean        fSaveSelection;        
  300.         
  301.         pascal void TSeqListDoc::ISeqListDoc(TFile itsFile)
  302.         pascal void TSeqListDoc::Free(void) // override 
  303.         pascal void TSeqListDoc::FreeData(void) // override 
  304.         pascal void TSeqListDoc::Close(void) // override 
  305.         
  306.         pascal void TSeqListDoc::AppendRead(short aRefNum)
  307.         pascal void TSeqListDoc::DoRead(TFile aFile, Boolean forPrinting) // override 
  308.         pascal void TSeqListDoc::AppendHandle( Handle aHand)
  309.         pascal void TSeqListDoc::DoReadHandle( Handle aHand)
  310.         pascal void TSeqListDoc::DoWrite(TFile aFile, Boolean makingCopy) // override 
  311.         pascal void TSeqListDoc::AboutToSaveFile(TFile theSaveFile, CommandNumber itsCmd, 
  312.                                                             Boolean VAR makingCopy) // override 
  313.  
  314.         pascal void TSeqListDoc::AddSeqToList(TSequence item)
  315.         pascal void TSeqListDoc::AddNewSeqToList(void)
  316.         pascal Boolean TSeqListDoc::ListIsEmpty(void)
  317.          
  318.         pascal void TSeqListDoc::DoSeqSelectCommand(void)
  319.          //override this to open sequences selected w/ dblclk
  320.          
  321.         pascal void TSeqListDoc::ShowReverted(void) // override 
  322.         pascal void TSeqListDoc::DoMakeViews(Boolean forPrinting) // override 
  323.                         
  324.         // Command Handlers 
  325.         pascal void TSeqListDoc::DoMenuCommand(CommandNumber aCommandNumber) // override 
  326.         pascal void TSeqListDoc::DoSetupMenus(void) // override 
  327.         }
  328.  
  329.  
  330.  
  331.     pascal void InitUSequence(void)  //read in std codon table, ...
  332.     
  333.  
  334. VAR
  335.     gSeqListDoc    : TSeqListDoc; //== gApp->fSeqListDoc
  336.     gREMap            : TREMap;        
  337.     gOutputName    : Str255;        
  338.     
  339. IMPLEMENTATION
  340.  
  341.         //$I USeqDoc.inc.p
  342.  
  343. }
  344.